//
//  HomeTableViewController.m
//  Item
//
//  Created by 刘炳举 on 16/1/10.
//  Copyright © 2016年 Kelly. All rights reserved.
//

#import "HomeTableViewController.h"
#import "TradeBuyInViewController.h"
#import "TradeBuyOutViewController.h"
#import "TradeFindViewController.h"
@interface HomeTableViewController ()

@end

@implementation HomeTableViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    // Uncomment the following line to preserve selection between presentations.
    // self.clearsSelectionOnViewWillAppear = NO;
    
    // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
    // self.navigationItem.rightBarButtonItem = self.editButtonItem;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 3;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 1;
}


-(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    switch (indexPath.section) {
        case 0:
            switch (indexPath.row) {
                case 0:
                    [self toTradeIn];
                    break;
                default:
                    break;
            }
            break;
        case 1:
            switch (indexPath.row) {
                case 0:
                    [self toTradeOut];
                    break;
                default:
                    break;
            }
            break;
        case 2:
            switch (indexPath.row) {
                case 0:
                    [self toTradeFind];
                    break;
                default:
                    break;
            }
            break;
        default:
            break;
    }
}

-(void)toTradeIn{
    TradeBuyInViewController* toBuyin = [self.storyboard instantiateViewControllerWithIdentifier:@"TradeBuyIn"];
    [self.navigationController pushViewController:toBuyin animated:NO];
}
-(void)toTradeOut{
    TradeBuyOutViewController* toSellOut = [self.storyboard instantiateViewControllerWithIdentifier:@"TradeBuyOut"];
    [self.navigationController pushViewController:toSellOut animated:NO];
}
-(void)toTradeFind{
    TradeFindViewController* toFind = [self.storyboard instantiateViewControllerWithIdentifier:@"FindCancellation"];
    [self.navigationController pushViewController:toFind animated:NO];
}

@end
